from aiogram.dispatcher.middlewares import BaseMiddleware

from config import Settings


class ConfigMiddleware(BaseMiddleware):
    def __init__(self, config: Settings):
        super().__init__()
        self.config = config

    async def on_pre_process_message(self, _, data: dict):
        data["config"] = self.config

    async def on_pre_process_callback_query(self, _, data: dict,):
        data["config"] = self.config